package com.lening.iot.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.common.base.BaseController;
import com.lening.iot.dto.AccontrolDTO;
import com.lening.iot.po.AccontrolPO;
import com.lening.iot.service.IAccontrolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.reactive.function.client.WebClient;

import java.util.List;

/**
 * @ToDo:
 * @Author：李忠达
 * @date: 2024/6/4 10:06
 */
@RestController
@RequestMapping("/accontrols")
public class AccontrolController extends BaseController<AccontrolPO, AccontrolDTO, IAccontrolService> {
    @Autowired(required = false)
    private WebClient webClient;

    @Autowired
    private IAccontrolService iAccontrolService;

    @GetMapping("/getAllAcl")
    public Page<AccontrolDTO> getAllAcl(Page<AccontrolDTO> accontrolDTO){
        Page<AccontrolDTO> accontrolList = iAccontrolService.getAllAcl(accontrolDTO);
        return accontrolList;
    }

    @GetMapping("/getAll")
    public List<AccontrolDTO>getAll(String communityName){
        List<AccontrolDTO> accList = iAccontrolService.getAll(communityName);
        return accList;
    }

//    @Override
//    @GetMapping("/page")
//    public Page<?> page(AccontrolDTO accontrolDTO) {
//        return iAccontrolService.getAllAcl(accontrolDTO);
//    }
}
